{
 "cells": [
  {
   "cell_type": "markdown",
   "source": [
    "# 深入条件控制\n",
    "`while` 和 `if` 条件句不止可以进行比较，还可以使用任意运算符。\n",
    "* 比较运算符`in` 和`not in` 用于执行确定一个值是否存在（或不存在）于某个容器中的成员检测。\n",
    "* 运算符`is` 和`is not` 用于比较两个对象是否是同一个对象。\n",
    "* 比较操作支持链式操作。例如，`a < b == c` 校验a是否小于b，且b是否等于c。\n",
    "* 布尔运算符`and` 和`or` 是短路运算符: 其参数从左到右求值，一旦可以确定结果，求值就会停止。\n",
    "* `and` 和`or` 和`not`优先级: `not` 最高， `or` 优先级最低"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%% md\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Tronhelm\n"
     ]
    }
   ],
   "source": [
    "str1, str2, str3 = '', 'Tronhelm', 'Hammer Dance'\n",
    "non_null = str1 or str2 or str3\n",
    "print(non_null)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}